package com.ansion.basetool.observer;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
 * created by zhaoyuntao
 * on 13/10/2022
 * description:
 */
public class CancelableHolder<O> extends ObjectHolder<O> {
    private boolean canceled;
    private final String key;

    public CancelableHolder(@Nullable O o, @NonNull String key) {
        super(o, null, false);
        this.key = key;
    }

    public void setCanceled(boolean canceled) {
        this.canceled = canceled;
    }

    public boolean isCanceled() {
        return canceled;
    }

    @NonNull
    public String getKey() {
        return key;
    }
}
